package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.check;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.check.FireCheckService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: FireCheckController
 * @Date: Created in 13:57 2024/3/19
 * @Description:
 */
@Action
@RequestMapping(value="check/fireCheck")
public class FireCheckController extends BaseController {

    @Resource
    private FireCheckService fireCheckService;


    /**
     * @Author YangYu
     * @Description 消防检查项列表
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "getCheckItemList", method = RequestMethod.GET)
    public RespEntity getCheckItemList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.getCheckItemList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查项-详情列表
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "getCheckItemDetailsList", method = RequestMethod.GET)
    public RespEntity getCheckItemDetailsList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.getCheckItemDetailsList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查任务新增
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "addCheckTask", method = RequestMethod.POST)
    public RespEntity addCheckTask(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.addCheckTask(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查任务列表
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "getCheckTaskList", method = RequestMethod.GET)
    public RespEntity getCheckTaskList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.getCheckTaskList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新检查任务状态
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "updateCheckState", method = RequestMethod.POST)
    public RespEntity updateCheckState(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.updateCheckState(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查内容新增、编辑
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "addOrUpdateCheckContent", method = RequestMethod.POST)
    public RespEntity addOrUpdateCheckContent(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.addOrUpdateCheckContent(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新整改信息
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "updateRectificationInfo", method = RequestMethod.POST)
    public RespEntity updateRectificationInfo(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.updateRectificationInfo(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查内容详情
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "checkContentDetails", method = RequestMethod.GET)
    public RespEntity checkContentDetails(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.checkContentDetails(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新整改期限
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "updateContentTime", method = RequestMethod.POST)
    public RespEntity updateContentTime(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.updateContentTime(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 整改内容列表
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "checkContentList", method = RequestMethod.GET)
    public RespEntity checkContentList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.checkContentList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 告知内容
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "checkInformContentList", method = RequestMethod.GET)
    public RespEntity checkInformContentList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.checkInformContentList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 查看是否存在未整改的状态
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "checkContentState", method = RequestMethod.GET)
    public RespEntity checkContentState(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.checkContentState(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查文件保存
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "checkFileAdd", method = RequestMethod.POST)
    public RespEntity checkFileAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.checkFileAdd(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 检查文件列表
     * @Date Created in 13:58 2024/3/19
     * @Param [jsonParam]
     */

    @At(value = "checkFileList", method = RequestMethod.GET)
    public RespEntity checkFileList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireCheckService.checkFileList(jsonParam);
    }

    /**
     * 保存巡查通知文件
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @PostMapping("inspectioNnotice")
    public RespEntity saveInspectioNnoticeFile(@RequestBody(required = false)JSONObject jsonObject) throws Exception {
        return fireCheckService.saveInspectioNnoticeFile(jsonObject);
    }

    /**
     * 保存复查单
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @PostMapping("reCheckBill")
    public RespEntity reCheckBill(@RequestBody(required = false)JSONObject jsonObject) throws Exception {
        return fireCheckService.reCheckBill(jsonObject);
    }

    /**
     * 统计隐患
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @At(value = "hazardStatistics", method = RequestMethod.GET)
    public RespEntity hazardStatistics(@RequestBody(required = false)JSONObject jsonObject) throws Exception {
        return fireCheckService.hazardStatistics(jsonObject);
    }

    /**
     * 隐患排名
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @At(value = "hazardRanking", method = RequestMethod.GET)
    public RespEntity hazardRanking(@RequestBody(required = false)JSONObject jsonObject) throws Exception {
        return fireCheckService.hazardRanking(jsonObject);
    }

    /**
     * 检查隐患详情数据
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @At(value = "checkHazardDetails", method = RequestMethod.GET)
    public RespEntity checkHazardDetails(@RequestBody(required = false)JSONObject jsonObject) throws Exception {
        return fireCheckService.checkHazardDetails(jsonObject);
    }

    /**
     * 统计生成的报告数
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @At(value = "checkFileCount", method = RequestMethod.GET)
    public RespEntity checkFileCount(@RequestBody(required = false)JSONObject jsonObject) throws Exception {
        return fireCheckService.checkFileCount(jsonObject);
    }

}
